#include <iostream>
#include <cstring>
#define size 10000
using namespace std;

bool visit[size];
int prime[size];


int main(int argc, char const *argv[])
{
    int k;
    cin >> k;
    memset(visit, false, sizeof(visit));
    memset(prime, 0, sizeof(prime));
    int cnt = 0,n;
    n = k;
    for(int i = 2;i <= n;i++){
        if(visit[i] == false){
            prime[++cnt] = i;
        }
        for(int j = 1;j<=cnt;j++){
            if(i*prime[j] > n){
                break;
            }
            visit[i*prime[j]] = true;
            if(i % prime[j] == 0){
                break;
            }
        }
    }

    for(int i=1;prime[i] != 0;i++){
        if(k % prime[i] == 0){
            cout << prime[i] << " ";
        }
    }
    return 0;
}
